package cloud.shyidong.core.context;

/**
 * @Description TODO
 * @Author syd
 * @Date 2023/3/27
 */
public class ContextHolder {
    
    private static final ThreadLocal<Context> contextThreadLocal = new InheritableThreadLocal<>();
    private static final ThreadLocal<String> tokenThreadLocal = new InheritableThreadLocal<>();
    
    public static Context getContext() {
        return contextThreadLocal.get();
    }
    
    public static void setContext(Context context) {
        contextThreadLocal.set(context);
    }
    
    public static String getToken() {
        return tokenThreadLocal.get();
    }
    
    public static void setToken(String token) {
        tokenThreadLocal.set(token);
    }
    
}
